package com.dduggs.exception;

/**
 * Service层公用的Exception
 *
 */
public class ServiceException extends RuntimeException {

	protected int errorCode;

	protected Object errorInfo;

	public ServiceException() {
        super();
	}

	public ServiceException(int errorCode, String message) {

		super(message);
		errorCode=errorCode;
		errorInfo=message;
	}

	public ServiceException(String message) {

		super(message);
		errorCode=1000;
		errorInfo=message;
	}

	public ServiceException(Throwable cause) {

		super(cause);
		errorCode=1000;
		errorInfo=cause;
	}

	public ServiceException(int errorCode, Throwable cause) {

		super(cause);
		errorCode=errorCode;
		errorInfo=cause;
	}

	public ServiceException(String message, Throwable cause) {

		super(message, cause);
		errorCode=1000;
		errorInfo=message;
	}

	public int getErrorCode(){

		return errorCode;
	}

	public void setErrorCode(int errorCode){

		this.errorCode = errorCode;
	}

	public Object getErrorInfo(){

		return errorInfo;
	}

	public void setErrorInfo(Object errorInfo){

		this.errorInfo = errorInfo;
	}
}